package com.thug.engine;

import java.util.ArrayList;


public abstract class EntityManager<T> {
	
	private final SceneManager mSceneMgr;
	protected ArrayList<T> mEntities;
	
	public EntityManager(final SceneManager s) {
		mSceneMgr = s;
		mEntities = new ArrayList<T>();
	}
	
	public SceneManager getSceneMgr() { return mSceneMgr; }

	public abstract void onLoad();

	public void addEntity(T entity) {
		mEntities.add(entity);
	}

	public abstract void update(final float elapsedTime);

	public void removeEntity(T entity){
		mEntities.remove(entity);
	}
	
	public ArrayList<T> getEntities() { return mEntities; }

	public abstract void onDestroy();

}
